//
//  KLViewModel.h
//  KoalaUtilKit
//
//  Created by Tommy on 15/1/4.
//  Copyright (c) 2015年 Alibaba-inc.com. All rights reserved.
//

#import "RVMViewModel.h"
#import "ReactiveCocoa.h"
#import "EXTScope.h"
#import "KLIViewModel.h"

@class KLService;
@class KLModel;


@interface KLViewModel : RVMViewModel<KLIViewModel>

@property(nonatomic,strong)id model;
@property(nonatomic,strong)id       modelService;

- (instancetype)initWithModelCls:(Class)modelCls;
- (instancetype)initWithModel:(KLModel*)model;
- (instancetype)initWithService:(id)service andModelCls:(Class)modelCls;



#pragma mark -
#pragma mark cache operations

- (RACCommand*)cacheToDisk;
- (RACCommand*)loadFromDisk;
- (RACCommand*)removeFromDisk;
/**
 *loadFromDisk will call this method
 */
- (void)parseModel:(id<NSCoding>) model;



@end
